import 'package:awak/common/models/room.dart';
import 'package:awak/common/models/comment.dart';
import 'package:awak/common/models/topic.dart';
import 'package:awak/common/models/content.dart';
import 'package:awak/common/models/review.dart';
import 'package:awak/common/models/chat.dart';
import 'package:awak/common/models/plan.dart';
import 'package:awak/common/models/today_goal.dart';

abstract class AwakEvent {}

// 登录
class LoginEvent extends AwakEvent {
  final String username;
  final String password;
  LoginEvent(this.username, this.password);
}

// 注册
class RegisterEvent extends AwakEvent {
  final String username;
  final String password;
  RegisterEvent(this.username, this.password);
} 

// 退出登录
class LogoutEvent extends AwakEvent {
  LogoutEvent();
}

// 检查当前登录用户
class CheckCurrentUserEvent extends AwakEvent {
  CheckCurrentUserEvent();
}

// 删除用户
class DeleteUserEvent extends AwakEvent {
  DeleteUserEvent();
}

// 获取所有房间
class FetchRoomsEvent extends AwakEvent {}
// 添加房间
class AddRoomEvent extends AwakEvent {
  final Room room;
  AddRoomEvent(this.room);
}
// 删除房间
class DeleteRoomEvent extends AwakEvent {
  final int id;
  DeleteRoomEvent(this.id);
}
// 更新房间
class UpdateRoomEvent extends AwakEvent {
  final Room room;
  UpdateRoomEvent(this.room);
}

// 获取指定房间的评论
class FetchCommentsByRoomIdEvent extends AwakEvent {
  final int roomId;
  FetchCommentsByRoomIdEvent(this.roomId);
}

// 添加评论
class AddCommentEvent extends AwakEvent {
  final Comment comment;
  AddCommentEvent(this.comment);
}

// 删除评论
class DeleteCommentEvent extends AwakEvent {
  final int id;
  DeleteCommentEvent(this.id);
}

// 获取所有主题
class FetchTopicsEvent extends AwakEvent {}

// 根据标签获取主题
class FetchTopicByLabelEvent extends AwakEvent {
  final String label;
  FetchTopicByLabelEvent(this.label);
}

// 添加主题
class AddTopicEvent extends AwakEvent {
  final Topic topic;
  AddTopicEvent(this.topic);
}

// 删除主题
class DeleteTopicEvent extends AwakEvent {
  final int id;
  DeleteTopicEvent(this.id);
}

// 更新主题
class UpdateTopicEvent extends AwakEvent {
  final Topic topic;
  UpdateTopicEvent(this.topic);
}

// 获取所有内容
class FetchContentsEvent extends AwakEvent {}

// 添加内容
class AddContentEvent extends AwakEvent {
  final Content content;
  AddContentEvent(this.content);
}

// 删除内容
class DeleteContentEvent extends AwakEvent {
  final int id;
  DeleteContentEvent(this.id);
}

// 获取指定内容的评论
class FetchReviewsByContentIdEvent extends AwakEvent {
  final int contentId;
  FetchReviewsByContentIdEvent(this.contentId);
}

// 添加评论
class AddReviewEvent extends AwakEvent {
  final Review review;
  AddReviewEvent(this.review);
}

// 删除评论
class DeleteReviewEvent extends AwakEvent {
  final int id;
  DeleteReviewEvent(this.id);
}

// 更新评论
class UpdateReviewEvent extends AwakEvent {
  final Review review;
  UpdateReviewEvent(this.review);
}

// 获取两个用户之间的聊天记录
class FetchChatMessagesEvent extends AwakEvent {
  final int userId1;
  final int userId2;

  FetchChatMessagesEvent(this.userId1, this.userId2);
}

// 发送聊天消息
class SendChatMessageEvent extends AwakEvent {
  final Chat chat;

  SendChatMessageEvent(this.chat);
}

// 删除聊天消息
class DeleteChatMessageEvent extends AwakEvent {
  final int chatId;

  DeleteChatMessageEvent(this.chatId);
}

// 清空两个用户之间的聊天记录
class ClearChatBetweenUsersEvent extends AwakEvent {
  final int userId1;
  final int userId2;

  ClearChatBetweenUsersEvent(this.userId1, this.userId2);
}

// 标记消息为已读
class MarkMessagesAsReadEvent extends AwakEvent {
  final int currentUserId;
  final int otherUserId;

  MarkMessagesAsReadEvent(this.currentUserId, this.otherUserId);
}

// 添加好友
class AddFriendEvent extends AwakEvent {
  final int userId;
  final int friendId;

  AddFriendEvent(this.userId, this.friendId);
}

// 删除好友
class RemoveFriendEvent extends AwakEvent {
  final int userId;
  final int friendId;

  RemoveFriendEvent(this.userId, this.friendId);
}

// 获取好友列表
class FetchFriendsEvent extends AwakEvent {
  final int userId;

  FetchFriendsEvent(this.userId);
}

// 检查是否是好友
class CheckFriendshipEvent extends AwakEvent {
  final int userId;
  final int friendId;

  CheckFriendshipEvent(this.userId, this.friendId);
}

// 创建计划
class CreatePlanEvent extends AwakEvent {
  final Plan plan;

  CreatePlanEvent(this.plan);
}

// 获取用户的所有计划
class FetchPlansEvent extends AwakEvent {
  final int userId;

  FetchPlansEvent(this.userId);
}

// 获取今天未完成的计划
class FetchTodayUncompletedPlansEvent extends AwakEvent {
  final int userId;

  FetchTodayUncompletedPlansEvent(this.userId);
}

// 获取本周的计划
class FetchThisWeekPlansEvent extends AwakEvent {
  final int userId;

  FetchThisWeekPlansEvent(this.userId);
}

// 更新计划状态
class UpdatePlanStateEvent extends AwakEvent {
  final int planId;
  final String state;

  UpdatePlanStateEvent(this.planId, this.state);
}

// 更新计划时间
class UpdatePlanTimeEvent extends AwakEvent {
  final Plan plan;

  UpdatePlanTimeEvent(this.plan);
}

// 更新超时计划状态
class UpdateExpiredPlansEvent extends AwakEvent {
  final int userId;

  UpdateExpiredPlansEvent(this.userId);
}

// 删除计划
class DeletePlanEvent extends AwakEvent {
  final int planId;

  DeletePlanEvent(this.planId);
}

// 获取未开始的计划
class FetchNotStartedPlansEvent extends AwakEvent {
  final int userId;

  FetchNotStartedPlansEvent(this.userId);
}

// 获取过去30天的历史计划
class FetchLast30DaysPlansEvent extends AwakEvent {
  final int userId;

  FetchLast30DaysPlansEvent(this.userId);
}

// 创建今日目标
class CreateTodayGoalEvent extends AwakEvent {
  final TodayGoal todayGoal;

  CreateTodayGoalEvent(this.todayGoal);
}

// 获取用户的今日目标
class FetchTodayGoalsEvent extends AwakEvent {
  final int userId;

  FetchTodayGoalsEvent(this.userId);
}

// 删除今日目标
class DeleteTodayGoalEvent extends AwakEvent {
  final int goalId;

  DeleteTodayGoalEvent(this.goalId);
}

// 批量删除今日目标
class DeleteTodayGoalsByIdsEvent extends AwakEvent {
  final List<int> goalIds;

  DeleteTodayGoalsByIdsEvent(this.goalIds);
}